package cn.darxs.noquestion.mapper;

import cn.darxs.noquestion.entity.Question;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface QuestionMapper extends BaseMapper<Question> {
    @Select("select * from question")
    List<Question> findAll();

    @Delete("delete from question where id = #{id}")
    public void delete(Integer id);

    @Update("update question set type=#{type}, description = #{description} where id =#{id}")
    public void update(Question q);
}
